-- CALC_SUMMON_ATTACK

-- 计算召唤兽当前攻击
-- @param summon    召唤兽
return function(summon)
    local attack = summon:query("attack") or 0;
    local classId = summon.class_id;
    local prop = {};

    -- TODO: 玩家对召唤兽属性加成%
    local addon = FormulaM.invoke("SUMMON_ATTRIB_ADDITION", summon, attack, "attack");

    -- 攻击+N
    prop = PropM.combine(summon, "attrib2", "attack");
    attack = PropM.apply(prop, attack);

    -- 根据楼层攻击+
    prop = PropM.combine(summon, "attrib_by_floor", "attack");
    if prop[3] > 0 then
        attack = PropM.trigger(summon, prop[1], prop[2], attack);
    end

    -- 所有召唤物能力加
    prop = PropM.combine(ME.user, "summon_attrib", "attack");
    attack = PropM.apply(prop, attack);

    -- 攻击+N
    attack = attack + summon.dbase:queryTemp("attack_addon", 0);

    -- TODO: 玩家的亡灵骨铠有加成
    if SummonM.query(classId, "dbase")["equipment_add"] == 1 then
        prop = PropM.combine(ME.user, "aid_attrib2", "attack");
        attack = PropM.apply(prop, attack);
    end

    return attack + addon;
end
